﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using SilverlightCairngorm;
using SilverlightCairngorm.Model;

namespace PowerArrow.nasa.Model
{
    public class PowerArrowModel : ModelLocator
    {
        private static readonly PowerArrowModel _instance = new PowerArrowModel();

        public static PowerArrowModel Instance { get { return _instance; } }

        static PowerArrowModel()
        {

        }

        private PowerArrowModel()
            : base()
        {

        }

        /// <summary>
        /// 背景状态
        /// </summary>
        private int _backgroundStatus = 2;
        public int BackgroundStatus
        {
            get { return _backgroundStatus; }
            set
            {
                _backgroundStatus = value;
                NotifyPropertyChanged("BackgroundStatus");
            }
        }

        /// <summary>
        /// 箭状态
        /// </summary>
        private string _arrStatus = ArrowViewStatus.General.ToString();
        public string ArrStatus
        {
            get { return _arrStatus; }
            set
            {
                _arrStatus = value;
                NotifyPropertyChanged("ArrStatus");
            }
        }

        /// <summary>
        /// 飞箭
        /// </summary>
        private bool _onFire = false;
        public bool OnFire {
            get { return _onFire; }
            set {
                _onFire = value;
                NotifyPropertyChanged("OnFire");
            }
        }

        /// <summary>
        /// 当前得分
        /// </summary>
        private int _currResult = 0;
        public int CurrResult {
            get { return _currResult; }
            set {
                _currResult = value;
                NotifyPropertyChanged("CurrResult");
            }
        }

        /// <summary>
        /// 检测得分
        /// </summary>
        private bool _chkResult = false;
        public bool ChkResult {
            get { return _chkResult; }
            set {
                _chkResult = value;
                NotifyPropertyChanged("ChkResult");
            }
        }

        /// <summary>
        /// 是否显示箭
        /// </summary>
        private bool _showArrow = true;
        public bool ShowArrow
        {
            get { return _showArrow; }
            set
            {
                _showArrow = value;
                NotifyPropertyChanged("ShowArrow");
            }
        }

        /// <summary>
        /// 六次积分
        /// </summary>
        #region 得分
        private int _s1 = 11;
        private int _s2 = 11;
        private int _s3 = 11;
        private int _s4 = 11;
        private int _s5 = 11;
        private int _s6 = 11;
        public int S1
        {
            get { return _s1; }
            set
            {
                _s1 = value;
                NotifyPropertyChanged("S1");
            }
        }
        public int S2
        {
            get { return _s2; }
            set
            {
                _s2 = value;
                NotifyPropertyChanged("S2");
            }
        }
        public int S3
        {
            get { return _s3; }
            set
            {
                _s3 = value;
                NotifyPropertyChanged("S3");
            }
        }
        public int S4
        {
            get { return _s4; }
            set
            {
                _s4 = value;
                NotifyPropertyChanged("S4");
            }
        }
        public int S5
        {
            get { return _s5; }
            set
            {
                _s5 = value;
                NotifyPropertyChanged("S5");
            }
        }
        public int S6
        {
            get { return _s6; }
            set
            {
                _s6 = value;
                NotifyPropertyChanged("S6");
            }
        }
        private int _totalScore = 0;
        public int TotalScore {
            get { return _totalScore; }
            set {
                _totalScore = value;
                NotifyPropertyChanged("TotalScore");
            }
        }
        private int _mission = 15;
        public int Mission {
            get { return _mission; }
            set {
                _mission = value;
                NotifyPropertyChanged("Mission");
            }
        }
        #endregion

        private int _level = 1;
        public int Level {
            get { return _level; }
            set {
                _level = value;
                NotifyPropertyChanged("Level");
            }
        }

        /// <summary>
        /// 当前积分指针
        /// </summary>
        private int _currS = 1;
        public int CurrS {
            get { return _currS; }
            set
            {
                _currS = value;
                NotifyPropertyChanged("CurrS");
            }
        }

        private bool _isFlying = false;
        public bool IsFlying
        {
            get { return _isFlying; }
            set { _isFlying = value; }
        }
    }

    public enum ArrowViewStatus
    {
        General,
        OnReady
    }
}
